import Cookies from 'js-cookie';
const key = 'cas-params';
export function setParams(params, flag = false) {
  let data = Cookies.get(key);
  if(!data || flag){
    data = '{}';
  }
  data = JSON.parse(data);
  //增加参数
  let cookieData = {
    ...data,
    ...params
  };
  Cookies.set(key,JSON.stringify(cookieData));
}

export function getParams(){
  let data = Cookies.get(key);
  if(data == undefined){
    return null;
  }
  return JSON.parse(data);
}